﻿ /*************************************************************************
File:   login.as
Author: Duykham
Date:   23/10/2006
TODO:
/*************************************************************************/
trace ("#included: as/login.as");
///////////////////////////////////////////////////////////////////////////
//TODO: for Test Config Script
trace ("CFG.showInfo: " + CFG.showInfo);
///////////////////////////////////////////////////////////////////////////
//
//var infoString = "<b>FMS Application:</b> " + CFG.fmsApp + "<br/>" + "<b>Web Directory:</b> " + CFG.webDir + "<br/>" + "<b>LoginUser:</b> " + CFG.loginUser + "<br/>"+ "<b>Login Password:</b> " + CFG.loginPass + "<br/>" + "<b>Sound File:</b> " + CFG.soundFile + "<br/>"+ "<b>Flash Only:</b> " + CFG.flashOnly + "<br/>"+ "<b>Show Info:</b> " + CFG.showInfo + "<br/>";
//var send_logInPHP = new LoadVars ();
//var result_logInPHP = new LoadVars ();
var checklog = 0;
//var checklog = 1;
//
login_btn.onRelease = function ()
{
	var logIn_lv : LoadVars = new LoadVars ();
	logIn_lv.onLoad = function (success : Boolean)
	{
		if (success)
		{
			_root.checklog = logIn_lv.checklog;
			//trace ("_root.checklog: "+_root.checklog);
			
		} else
		{
			//nothing
			trace ("error!");
		}
	};
	logIn_lv.load (_root.CFG.webAdd + "login.php?user=" + _root.user_txt.text + "&pass=" + _root.pass_txt.text)
};

//
this.onEnterFrame = function ()
{
	if (_root.checklog == 1)
	{
		_root.gotoAndStop ("strm1");
		//_root.gotoAndPlay ("nothing");
	}
	if (_root.checklog == 2)
	{
		_root.gotoAndStop ("error");
	}
	if (Key.isDown (Key.ENTER))
	{
		login_btn.onRelease ();
		//trace ("Enter down!")
	}
}

//info_txt._visible = false;
